package blog.modelo;

// Generated Oct 24, 2014 1:54:18 PM by Hibernate Tools 4.3.1

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * BlogComment generated by hbm2java
 */
@Entity
@Table(name = "blog_comment")
public class BlogComment implements java.io.Serializable {

	private BlogCommentId id;
	private BlogPost blogPost;
	private BlogUser blogUser;
	private int isReplyToId;
	private String comment;
	private Boolean markRead;
	private boolean enabled;
	private Date date;

	public BlogComment() {
	}

	public BlogComment(BlogCommentId id, BlogPost blogPost, BlogUser blogUser,
			int isReplyToId, String comment, boolean enabled) {
		this.id = id;
		this.blogPost = blogPost;
		this.blogUser = blogUser;
		this.isReplyToId = isReplyToId;
		this.comment = comment;
		this.enabled = enabled;
	}

	public BlogComment(BlogCommentId id, BlogPost blogPost, BlogUser blogUser,
			int isReplyToId, String comment, Boolean markRead, boolean enabled,
			Date date) {
		this.id = id;
		this.blogPost = blogPost;
		this.blogUser = blogUser;
		this.isReplyToId = isReplyToId;
		this.comment = comment;
		this.markRead = markRead;
		this.enabled = enabled;
		this.date = date;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "id", column = @Column(name = "id", nullable = false)),
			@AttributeOverride(name = "userId", column = @Column(name = "user_id", nullable = false)) })
	public BlogCommentId getId() {
		return this.id;
	}

	public void setId(BlogCommentId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "post_id", nullable = false)
	public BlogPost getBlogPost() {
		return this.blogPost;
	}

	public void setBlogPost(BlogPost blogPost) {
		this.blogPost = blogPost;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false, insertable = false, updatable = false)
	public BlogUser getBlogUser() {
		return this.blogUser;
	}

	public void setBlogUser(BlogUser blogUser) {
		this.blogUser = blogUser;
	}

	@Column(name = "is_reply_to_id", nullable = false)
	public int getIsReplyToId() {
		return this.isReplyToId;
	}

	public void setIsReplyToId(int isReplyToId) {
		this.isReplyToId = isReplyToId;
	}

	@Column(name = "comment", nullable = false, length = 65535)
	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Column(name = "mark_read")
	public Boolean getMarkRead() {
		return this.markRead;
	}

	public void setMarkRead(Boolean markRead) {
		this.markRead = markRead;
	}

	@Column(name = "enabled", nullable = false)
	public boolean isEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
